<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

    <meta name="author" content="http://www.huayingsoft.com/" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=8,IE=9,IE=10" />
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store">

    <link rel="stylesheet" href="../../css/bootstrap.min.css">
    <link rel="stylesheet" href="../../css/bootstrapEx.css">

    <script src="../../js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="../../js/bootstrap.min.js"></script>
    <script type="text/javascript" src="../../js/bootstrapEx2.0.js"></script>
</head>

<body>
    <span style='font-size:20px;font-weight:bold;'>Confirm确认框</span>
    <p/>
    <p/>
    <button id="btn1" class="btn btn-primary" type="button">弹出确认框</button>
    <p/>
    <button id="btn2" class="btn btn-primary" type="button">弹出确认框，带消失事件</button>
    <p/>
    <button id="btn3" class="btn btn-primary" type="button">弹出确认框，自定义按钮</button>
    <p/>
</body>
<script>
    var Modal1;//Hello World 设置窗口大小
    var Modal2;//最大化窗口 添加按钮
    $(document).ready(function () {
        //弹出确认框
        $("#btn1").click(function () {
            bsEx.Confirm("提示","是否确认删除",function(t,btn){
                //1秒后重置按钮 关闭确认框
                btn.loading().delay(1000).queue(function() {
                    btn.reset();
                    $(this).dequeue();
                    t.hide();
                    bsEx.Alert("提示","删除成功",2);
			    });
            })
        });
        //弹出确认框，带消失事件
        $("#btn2").click(function () {
            bsEx.Confirm("提示","是否确认删除",function(t,btn){
                btn.loading().delay(1000).queue(function() {
                    btn.reset();
                    $(this).dequeue();
                    t.hide();
                    bsEx.Alert("提示","删除成功",2);
			    });
            },function(){
                bsEx.Alert("提示","取消删除",2);
            })
        });
        //弹出确认框，自定义按钮
        $("#btn3").click(function () {
            bsEx.Confirm("提示","是否确认删除",[
                {"text":"还不确定","id":"btn3_1"},
                {"text":"再想想","id":"btn3_2"},
                {"text":"算了","id":"btn3_3"}
            ])
        });
    });

    function btn3_1_onclick(t,m){
        m.hide();
        bsEx.Alert("自定义按钮",t.text,2)
    }
    function btn3_2_onclick(t,m){
        m.hide();
        bsEx.Alert("自定义按钮",t.text,2)
    }
    function btn3_3_onclick(t,m){
        m.hide();
        bsEx.Alert("自定义按钮",t.text,2)
    }
</script>
</html>